

#ifndef MAIN_H
#define MAIN_H

#ifndef TRANSLATIONDIR
#define TRANSLATIONDIR "/opt/opennav/locale/"
#endif
#ifndef IMAGEDIR
#define IMAGEDIR "/opt/opennav/data/images/"
#endif

class Clock;
class PositioningSystem;
class SearchService;
class Settings;
class RouteSettings;
class RoutingService;
class QString;

namespace opennav {
	class Map;
	class MapRouter;
	class QtFile;
}

class Main {

public:
	static const char* ORGANIZATION_NAME(){
		return "HTWK";
	};
	static const char* APPLICATION_NAME(){
		return "OpenNav";
	};

	static Main& getInstance();

	~Main();

	bool init(int argc, char** argv);	// public init. "two phase"-construction method - needed for parsing argument-line parameters and for initializing other classes
	void destruct();

	Clock& getClock() const;
	PositioningSystem& getPositioningSystem() const;
	Settings& getSettings() const;
	opennav::Map& getMap() const;
	SearchService& getSearchService() const;

	RoutingService& getRoutingService() const;
	RouteSettings* getRouteSettings() const;

	void normalMode();
	void powerSave();

	bool isMoving();
	bool isNavigating();

private:
	static Main* instance;

	Main();
	void construct();	// private two-phase constructor because we'll need the reference to Main for some here executed class constructions
	
	Clock* clock;
	PositioningSystem* position;
	Settings* settings;

	RouteSettings* routeSettings;
	SearchService* searchService;
	RoutingService* routingService;

	opennav::Map* map;
};


#endif
